import Cookies from 'js-cookie'
const TokenKey = 'hrsaas-ihrm-token' // 设定一个独一无二的key

const TokenTime = 'hrsaas-ihrm-token-Time' // 声明变量存储时间戳

// 从cookies中获取时间戳
export function getTimeStamp() {
  return Cookies.get(TokenTime)
}
// 存储获取到token存储事件
export function setTimeStamp() {
  return Cookies.set(TokenTime, Date.now())
}

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
